package practice1C;

import java.io.IOException;

import javax.xml.bind.JAXBException;

import org.jdom.Comment;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;

/**
 * @author $Author:$
 * @version $Id: $
 */
public class Main {
	public static void main(String[] args) throws JAXBException, IOException {
		
		Document doc = new Document();
		
		doc.addContent(new Comment(" Generated automatically. Don't change it. "));
		Element clazz = new Element("class");
		doc.addContent(clazz);
		
		clazz
			.addContent(new Element("student")
				.addContent(new Element("name").setText("Alberto"))
				.addContent(new Element("age").setText("21"))
				.setAttribute("id", "201134441110"))
			.addContent(new Element("student")
				.addContent(new Element("name").setText("Patricia"))
				.addContent(new Element("age").setText("22"))
				.setAttribute("id", "201134441116"))
			.addContent(new Element("student")
				.addContent(new Element("name").setText("Luis"))
				.addContent(new Element("age").setText("21"))
				.setAttribute("id", "201134441210"));
		
	
		XMLOutputter out = new XMLOutputter(Format.getPrettyFormat());
		out.output(doc, System.out);
	}
}
